/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cx1.model.utils;

import org.apache.commons.lang.StringUtils;
import org.cx1.model.PlaceType;

/**
 *
 * @author CX
 */
public class KPlaceTypes {
    
    public static final PlaceType COUNTRY = new PlaceType("1", "Country", null, null);
    public static final PlaceType REGION = new PlaceType("2", "Region", null, null);
    public static final PlaceType CITY = new PlaceType("3", "City", null, null);
    public static final PlaceType DISTRICT = new PlaceType("4", "Disrict", null, null);
    public static final PlaceType BUILDING = new PlaceType("5", "Building", null, null);
    public static final PlaceType VILLAGE = new PlaceType("6", "Village", null, null);
    
    //CX: TODO: temporary service
    public static PlaceType getPlaceType(String id) {
        PlaceType propertyType = null;
        if (StringUtils.equals(id, KPlaceTypeIDs.COUNTRY)) {
            propertyType = COUNTRY;
        }
        else if (StringUtils.equals(id, KPlaceTypeIDs.REGION)) {
            propertyType = REGION;
        }
        else if (StringUtils.equals(id, KPlaceTypeIDs.CITY)) {
            propertyType = CITY;
        }
        else if (StringUtils.equals(id, KPlaceTypeIDs.DISTRICT)) {
            propertyType = DISTRICT;
        }
        else if (StringUtils.equals(id, KPlaceTypeIDs.BUILDING)) {
            propertyType = BUILDING;
        }        
        else if (StringUtils.equals(id, KPlaceTypeIDs.VILLAGE)) {
            propertyType = VILLAGE;
        }
        return propertyType;
    }
}
